import Vue from 'vue'
import VueRouter from 'vue-router'
import login from '@/pages/login'
import layout from '@/components/layout'

Vue.use(VueRouter)

export default new VueRouter({
  routes: [
    {
      name: 'login',
      path: '/',
      component: login
    },
    {
      name: 'welcome',
      path: '/main',
      component: layout,
      children: [
        {
          name: 'welcome',
          path: 'index',
          component: () => import('@/pages/welcome')
        },
        {
          name: 'blogList',
          path: 'blogList',
          component: () => import('@/pages/blog/blogList')
        },
        {
          name: 'addBlog',
          path: 'addBlog',
          component: () => import('@/pages/blog/addBlog')
        }
      ]
    }
  ]
})
